import Vue from 'vue';
import PopView from './pop.vue';
let PopConstructor  = Vue.extend(PopView);

let instance;

var SignPop = function(options) {
    if (Vue.prototype.$isServer) return;
    options = options || {};

    instance = new PopConstructor({
        data : options,
        methods : {
            closeWin () {
                SignPop.close();
            }
        }
    });
    instance.vm = instance.$mount();

    document.body.appendChild(instance.vm.$el);
    instance.vm.visible = true;
    instance.dom = instance.vm.$el;
    return instance.vm;
};


SignPop.close = function() {
    document.body.removeChild(instance.$el);
};


export default SignPop;